<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .login {
      width: 600px;
      margin: 80px auto;
      background: #444;
      border-radius: 20px;
      padding: 30px;
      text-align: center;
    }
    h1 {
      color: #fff;
    }
    ul {
      list-style: none;
    }
    li {
      margin-bottom: 20px;
    }
    label {
      display: inline-block;
      color: #fff;
      width: 60px;
      text-align: right;
      padding-right: 12px;
      font-size: 12px;
    }
    input {
      padding: 8px 12px;
      border: 1px solid yellow;
      border-radius: 5px;
      outline: none;
    }
    .opera {
      text-align: center;
    }
    button {
      padding: 8px 80px;
    }
  </style>
</head>
<body>
<header></header>
<div id="app">
  <div class="login">
    <h1>登录</h1>
    <ul>
      <li>
        <label>用户名</label>
        <input type="text" placeholder="请输入用户名" v-model="loginForm.username">
      </li>
      <li>
        <label>密码</label>
        <input type="password" placeholder="请输入密码"v-model="loginForm.password">
      </li>
    </ul>
    <div class="opera">
      <button @click="login">登录</button>
    </div>
  </div>
</div>
<footer></footer>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
  (function () {
    new Vue({
      el: '#app',
      data: {
        loginForm: {
          username: '',
          password: ''
        }
      },
      methods: {
        login () {
          console.log(this.loginForm)
          // ajax(this.loginForm)
        }
      }
    })
  })()
</script>
</body>
</html>
